1. Field of the Invention
The present invention relates to a motion estimation method used in a video compression algorithm of a mobile device, and more particularly, to a method for effectively implementing a motion estimation algorithm which occupies a large amount of a video compression in implementing an MPEG-4 video encoder on an embedded system such as a mobile device having a small memory.
2. Description of the Related Art
A low bit rate video compression algorithm used in an embedded system is a standard MPEG-4. The basic structure of the encoder, as shown in FIG. 1, includes a rectangular texture encoding unit 1 used for general video compression, and a shape encoding unit 2 for compressing a shape. The encoder can be used for various applications. The texture encoding unit 1 compresses unnecessary data on space information and time information. Today, the texture encoding unit 1 have been developed and widely used as various standard common algorithms.
This algorithm compresses information on space and time. It requires a discrete cosine transformation (DCT)/inverse discrete cosine transformation (IDCT) process and a quantization process to compress space information. To compress information on time, it is needed a motion estimation process, a motion compensation process and a buffering process for storing a previous screen. A variable length encoder compresses the quantized data of space information and time information according to information probability.
A motion detector 10 needs a lot of memory accesses and a large memory size in implementing a MPEG-4 algorithm and greatly influences the performance of the MPEG-4 video encoder algorithm. There is a kind of pictures that is P-frame or B-frame, according to the frame direction of motion estimation. However, their motion estimations are similar to each other in that they estimate motion vector by using memory access of a current macro-block and a reference search area of a previous or next frame. So, only the motion estimation unit for P-frames will be described in this specification. The motion detector 10 for P-frames estimates motion vectors by using previous frame (t−1) and the current frame (t) as shown in FIG. 2A. In other words, the motion detector 10 finds the most similar location by moving a macro-block of the current frame on a reference search area of a previous frame by pixel. A mean square error (MSE) method, a sum of absolute difference (SAD) method and a mean absolute difference (MAD) method are proposed as the methods to find similarity of a current macro-block and a reference search area.
FIGS. 2A and 2B illustrate a conventional implementation of a motion estimation method according to an MPEG-4 video encoding algorithm. In the conventional motion estimation method shown in FIG. 2A, a reference frame and a current frame are stored in an external memory to find similarity. The higher frame resolution the video has, the more memory the method requires. Accordingly, when an internal memory has a small capacity, an external memory should be used since the internal memory cannot store all the data. When an external memory is used, the system implementing the method becomes slower, since the external memory is slower to be accessed compared with internal memory within a microprocessor. Furthermore, since frequent access to the external memory consumes a large amount of electric power, the method could not be applied to a mobile terminal which attaches importance to power consumption to use a battery for a long time.
In the conventional motion estimation method shown in FIG. 2B, a method of double buffering is used to overcome the disadvantage of the method described in FIG. 2A. To effectively use the double buffering method, direct memory access (DMA) should be used, in which data are transferred between memories without any intervention of a main-processor. In other words, when one macro block is executed, a reference search area stored in a first buffer shown in FIG. 2B is used, and simultaneously a next reference search area is stored in a second buffer shown in FIG. 2B by using the DMA without any intervention of the main-processor. If motion estimation is performed on an intended macro block, the next reference search area that was moved using DMA beforehand is used to find a motion vector so as to perform motion estimation on the next macro block.
In an embedded system such as a mobile terminal, the frequency of the processor is much lower than that of a general processor due to power management of a mobile battery. And the internal memory has a small capacity because of commercial business. Accordingly, to implement a very complex MPEG-4 video encoder compression algorithm in the mobile terminal, it is necessary to effectively configure a motion estimation part that consume a lot of electric power as well as compression time.
In the related art, when the motion vector is estimated, all the entire image is stored in an external memory of the mobile terminal without relation to the type or the size of memory, and MSE values or SAD values between two macro-blocks are compared with each other to determine a motion vector to be the location that has a minimum value of MSE or SAD. However, the mobile terminal having a small internal memory is required to more effectively use its memory. In other words, if an image is stored in an external memory so as to be used, the performance of the processor is lowered and consumption power is increased. So, the method is required in which the frequency of accesses to the external memory should be minimized and in which the external memory should be accessed block by block so as to consecutively access to the external memory when accessing to the external memory, so that the internal memory can be used more effectively.